// 问题
const mongoose = require('mongoose')

const {Schema, model} = mongoose

const QuestionSchema = new Schema({
  __v:{type: Number,select:false},
  title:{ type: String, required: true}, // 问题名
  description: {type: String}, // 问题描述
  questioner: {type: Schema.Types.ObjectId, ref:'User', required:true, select: false}, // 提问者
  topics: {type: [{type: Schema.Types.ObjectId, ref: 'Topic'}], select: false}, // 话题的引用
})

module.exports = model('Question', QuestionSchema)